// All server settings are described on this file. These will be appended to the base
// Expresser Settings class, and some of the Expresser settings might not be defined
// here (and in this case it will use the default values).
//
// ATTENTION!!! We recommend you to create a settings.development.json on your development
// machine and a settings.production.json on your live environment. The Settings class will
// look for these files as well (depending on the NODE_ENV variable). If you edit this
// settings.json file you might lose changes whenever you pull again from GitHub.
//
// For more details on Expresser settings: https://expresser.codeplex.com/wikipage?title=Settings

{
    // GENERAL SETTINGS
    "general": {
        // The app title.
        "appTitle": "System App",
        // Only set debug = true on development and testing environments!
        // Leaving it null will automatically set to false on production.
        "debug": null,
        // Set the support email which is displayed and provided to users
        // in case they need support. For example: system-support@mycompany.com
        "supportEmail": null
    },

    // EXPRESSER APP SETTINGS
    "app": {
        // Leave paas = true if you're deploying to a PaaS provider.
        "paas": true,
        // Port on which the server will run. If left blank, default 8080 will be used.
        "port": 3003
    },

    // SPECIAL PATHS
    "path": {
        // Path where downloads will be stored.
        "downloadsDir": "./public/downloads/",
        // Path where images are stored.
        "imagesDir": "./public/images/"
    },

    // IMAGE HANDLING SETTINGS
    "images": {
        // Size of map thumbnails (width) when converting from SVG to PNG.
        "mapThumbSize": 600
    },

    // MONGODB SETTINGS
    "database": {
        // The database connection string is DB "systemapp" running under "localhost" by default.
        // Do not forget to include "mongodb://" before the hostname.
        "connString": "mongodb://localhost/systemapp",
        // For how many hours should the DB keep insert/update/delete logs? Default is 2 hours.
        "logExpires": 2
    },

    // GENERAL WEB CONNECTIONS SETTINGS
    "web": {
        // Generate an error alert after a download has failed X manytimes.
        "alertAfterFailedDownloads": 5,
        // The amount of time to wait for new connection requests, in case the internet
        // or network is down. Time in milliseconds.
        "connRestartInterval": 120000,
        // Timeout to wait for downloads to complete
        "downloadTimeout": 30000,
        // Credentials (user and password) when downloading external contents (Audit Data and Entity Objects, for example).
        // Please note that this will be used for ALL requests. If you need to pass credentials for only a specific
        // URL, use the `http://username:password@domain.com/path` format on that particular URL.
        "downloaderUser": null,
        "downloaderPassword": null,
        // Headers to add to requests when downloading external contents, accepting key:value properties.
        // For example the Pingdom API requires an `App-Key` to be passed, so you could add here:
        // {"App-Key":"my-pingdom-api-key"}.
        "downloaderHeaders": null,
        // The minimum time between external data refresh, in seconds.
        "minimumRefreshInterval": 3,
        // If true, all JSON response will be minified before passed to the clients.
        "minifyJsonResponse": true
    },

    // LOGGER SETTINGS
    "logger": {
        // By default, local logging is enabled and will save logs to the /logs folder. If you wish
        // to use Logentries or Loggly, please read: https://expresser.codeplex.com/wikipage?title=Logger
        "local": {
            "enabled": true
        }
    },

    // PASSPORT AND AUTHENTICATION SETTINGS
    "passport": {
        // Parameters to be passed to the passport module.
        "params": {
            "successRedirect": "/",
            "failureRedirect": "/login",
            "failureFlash": true,
            "session": true
        },
        // By default the System App will use basic HTTP authentication.
        "basic": {
            "enabled": true
        },
        // If you want to use LDAP, set the information below.
        "ldap": {
            "enabled": false,
            // The properties below set the path and behaviour of LDAP connections.
            "server": null,
            "adminDn": null,
            "adminPassword": null,
            "searchBase": null,
            "searchFilter": null,
            // Users created automatically from LDAP must have a password, so use this value as a prefix.
            "userPasswordPrefix": "ldap-",
            "tlsOptions": {
                // By default it won't reject unknown CAs. If you need to use your own CA certificate
                // please set it on the "ca" variable above and change "rejectUnauthorized" to true.
                "rejectUnauthorized": false,
                "ca": null
            }
        }
    },

    // SECURITY SETTINGS
    "security": {
        // If you want to give explicit admin permission to specific users, set their username
        // on the list below. This is useful when you set LDAP and need to access the admin area
        // to give initial permissions. Example: ["igor.ramadas","anotheruser"]
        "forcedAdmins": [],
        // If true, users will be able to see the app in read-only mode when not authenticated.
        // In this case, to authenticate, they'll have to manually access the /login page.
        "guestEnabled": true,
        // Redirect user to 401 page after X failed logins.
        "maxFailedLogins": 3,
        // Key used for session encryption.
        // IMPORTANT! If you change the sessionKey, current sessions will be invalidated!
        "sessionKey": "Ss!0nPROtw",
        // For how many seconds should the logged users cache keep data?
        "userCacheExpires": 30,
        // Key used for user password encryption.
        // IMPORTANT! If you change the userPasswordKey after creating users, their passwords
        // will be invalidated and they won't be able to login UNLESS you manually update the
        // database with the new password hashes!
        "userPasswordKey": "P4sssYs13!"
    }
}